#ifndef __VARIABLENODE__

#define __VARIABLENODE__

#include"expressionnode.h"
#include"namestorage.h"

using namespace std;

class VariableNode : public ExpressionNode {
	
	public:
	
	static NameStorage names;
	
	int var;
	
	//VariableNode();
	VariableNode(VariableNode const &);
	VariableNode(string const &, bool = false);
	~VariableNode();
	
	bool operator ==(VariableNode const &) const;
	
	ProgramNode * defun() const;
	IntegerNode deint() const;
	string toString() const;
	ExpressionNode * copy() const;
	bool isFreeVar(VariableNode const &) const;
	bool isBoundVar(VariableNode const &) const;
	VariableNode rename();
	ExpressionNode * eval(ProgramNode const &) const;
	ExpressionNode * subst(VariableNode const &, ExpressionNode const *);
	
};

#endif
